package com.power.test;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.power.test.model.json.JsonHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * spring boot mvc 配置类
 */
@Configuration
public class WebAppConfig implements WebMvcConfigurer {

	/**
	 * Json序列化和反序列化转换器，用于转换Post请求体中的json以及将我们的对象序列化为返回响应的json
	 */
	@Bean
	public ObjectMapper objectMapper() {
		return JsonHelper.getMapper();
	}

}
